package com.xique.client.service.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xique.client.bean.domain.OpengateRecords;
import com.xique.client.mapper.OpengateRecordsMapper;
import com.xique.client.service.service.IOpengateRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 开关闸记录Service业务层处理
 * 
 * @author xique
 * @date 2022-01-13
 */
@Service
public class OpengateRecordsServiceImpl implements IOpengateRecordsService
{
    @Autowired
    private OpengateRecordsMapper opengateRecordsMapper;

    /**
     * 查询开关闸记录
     * 
     * @param id 开关闸记录ID
     * @return 开关闸记录
     */
    @Override
    public OpengateRecords selectOpengateRecordsById(Long id)
    {
        return opengateRecordsMapper.selectById(id);
    }

    /**
     * 查询开关闸记录列表
     * 
     * @param opengateRecords 开关闸记录
     * @return 开关闸记录
     */
    @Override
    public List<OpengateRecords> selectOpengateRecordsList(OpengateRecords opengateRecords)
    {
        QueryWrapper<OpengateRecords> wrapper = new QueryWrapper<>();
        return opengateRecordsMapper.selectList(wrapper);
    }

    /**
     * 新增开关闸记录
     * 
     * @param opengateRecords 开关闸记录
     * @return 结果
     */
    @Override
    public int insertOpengateRecords(OpengateRecords opengateRecords)
    {
        return opengateRecordsMapper.insert(opengateRecords);
    }

    /**
     * 修改开关闸记录
     * 
     * @param opengateRecords 开关闸记录
     * @return 结果
     */
    @Override
    public int updateOpengateRecords(OpengateRecords opengateRecords)
    {
        return opengateRecordsMapper.updateById(opengateRecords);
    }

    /**
     * 批量删除开关闸记录
     * 
     * @param ids 需要删除的开关闸记录ID
     * @return 结果
     */
    @Override
    public int deleteOpengateRecordsByIds(List<Long> ids)
    {
        return opengateRecordsMapper.deleteBatchIds(ids);
    }

    /**
     * 删除开关闸记录信息
     * 
     * @param id 开关闸记录ID
     * @return 结果
     */
    @Override
    public int deleteOpengateRecordsById(Long id)
    {
        return opengateRecordsMapper.deleteById(id);
    }
}
